home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / comm / tlx_sq15.zip / LOGOFF.SLT < prev    next >
Text File  |  1990-10-21  |  1KB  |  47 lines

  1. //-----------------------------------------------------------
  2. // LOGOFF.SL? Toggle Auto Logoff setting.
  3. //
  4. // This script is executed if you press Alt-Q while being online.
  5.  
  6.  
  7. // Please look at the comments through the whole file, and modify to
  8. // suit your needs, BEFORE you use it. Then recompile with CS LOGOFF.
  9.  
  10. // If you have suggestions for improving this script, please suggest
  11. // improvements to me via old-fashioned snail-mail to:
  12.  
  13. //   Inge Vabekk
  14. //   Hamangskogen 108
  15. //   N-1300 SANDVIKA
  16. //   NORWAY                   
  17. //-----------------------------------------------------------
  18.  
  19. str sline  [20]
  20.    ,global []="GLOBAL"
  21.    ,change []="CHANGE"
  22.    ,logoff []="LOGOF"
  23.    ,display[]="DISPLAY"
  24.    ,read[]="R"                 // To READ from Global script.
  25.    ,write[]="W"                // To WRITE to Global script.
  26.    ;
  27.  
  28. //-----------------------------------------------------------
  29. // Script starts here.
  30. //-----------------------------------------------------------
  31.  
  32. main()
  33. {
  34.   if (!call (global,read,logoff,sline))  // Nothing defined?
  35.     call (global,write,logoff,"YES");
  36.  
  37.   else
  38.   { if (strposi (sline,"YES",0) == 0)    // Logoff?
  39.       call (global,write,logoff,"NO");   // Toggle to NO.
  40.     else
  41.       call (global,write,logoff,"YES");  // Toggle to YES.
  42.   }
  43.   call (global,write,change,"YES");      // Define CHANGE.
  44.   call ("display");
  45.   return (0);
  46. }
  47.